"version 1.0"

"去掉vi的一致性"
set nocompatible
"显示行号"
"set number"
" 隐藏滚动条"    
"set guioptions-=r“
"set guioptions-=L"
"set guioptions-=b"
"隐藏顶部标签栏"
"set showtabline=0"
"设置字体"
"set guifont=Monaco:h13 "
"开启语法高亮"       
syntax on 
"设置背景色"  
set background=dark     
"设置不折行"
set nowrap 
"设置以unix的格式保存文件" 
set fileformat=unix 
"设置C样式的缩进格式"
"set cindent"
"设置table长度"     
set tabstop=4
set shiftwidth=4 
"tab转换为空格"  
"set expandtab
"自动缩进"
"set autoindent
"对Python 文件有效
autocmd FileType python set tabstop=4 | set expandtab | set autoindent
"智能对齐"
set smartindent
"自动重新加载"
set autoread
"未保存或只读提示"
set confirm
"显示匹配的括号"       
set showmatch 
"距离顶部和底部5行"  
set scrolloff=5 
"命令行为两行"    
set laststatus=2   
"文件编码" 
set fenc=utf-8      
set backspace=2
"启用鼠标"
if has('mouse')
  set mouse=a
endif
set selection=exclusive
set selectmode=mouse,key
set matchtime=5
"忽略大小写"
"set ignorecase"
"set incsearch"
"高亮搜索项"
set hlsearch  
"不允许扩展table"      
set noexpandtab     
set whichwrap+=<,>,h,l
set autoread
"突出显示当前行"
set cursorline  
"突出显示当前列"    
"set cursorcolumn"

"按F5运行"

map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
	exec "w"
	if &filetype == 'c'
		exec "!g++ % -o %<"
		exec "!./%<"
	elseif &filetype == 'cpp'
		exec "!g++ % -o %<"
		exec "!./%<"
	elseif &filetype == 'sh'
		:!bash %
	elseif &filetype == 'python'
		exec "!python2.7 %"
	endif
endfunc

